﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using Kokomo.Environment;
using System.Windows.Input;
using Kokomo.Environment.Documents;

namespace Kokomo.PeInspector.Reflection
{
	[ViewType(typeof(DependencyGraphsView))]
	class DependencyGraphsViewModel : NotifierObject
	{
		public DependencyGraphsViewModel(
			ICommand navigateToCommand
			)
		{
			this.NavigateToCommand = navigateToCommand;
			this._graphRootNodes = new ObservableCollection<TreeNodeViewModel>();
		}

		public ICommand NavigateToCommand { get; private set; }

		#region Graphs
		private ObservableCollection<TreeNodeViewModel> _graphRootNodes;
		public IEnumerable<TreeNodeViewModel> GraphRootNodes
		{
			get { return this._graphRootNodes; }
		}

		public void AddGraph(DependencyGraphViewModel graph)
		{
			if (graph == null) throw new ArgumentNullException("graph");

			this._graphRootNodes.Add(graph.RootNode);
		}
		#endregion

	}
}
